UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nkUUYL4V+iyKwZJpE4AEJbx5sJYtP8PPZZga9TFLn0w=' 
WHERE 
  key_id = '2fb02a26cf8dcc48d36c9d7b2ae38a8c2a92fa223b60526aff7aa2fdee538036' 
  AND (
    token = 'nkUUYL4V+iyKwZJpE4AEJbx5sJYtP8PPZZga9TFLn0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038