UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b+zfrN1Q8kjURR3B2lnF3WgGfx8fbeHhCTXTiyeuU0E=' 
WHERE 
  key_id = '4006f395e2839fe45e43a7296ba5757d9c9e1558fa2f20f84cb441cc05e3fc2f' 
  AND (
    token = 'b+zfrN1Q8kjURR3B2lnF3WgGfx8fbeHhCTXTiyeuU0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031