UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TWGn3RmL1WtGWxxtiy1acFu7eN8ODbxkBs0nzCekH48=' 
WHERE 
  key_id = 'bbba45f5ea3437e7f982817705035c474c3e4e0b4b7eaf5a51b45806235fc453' 
  AND (
    token = 'TWGn3RmL1WtGWxxtiy1acFu7eN8ODbxkBs0nzCekH48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046