UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'caJ8xYcgo1khYU7BlJbuR2FaTu3Chc/a+F3sZK+4xXg=' 
WHERE 
  key_id = '85353c3287e37c11cc2cf26362323350088b1e2a32b1aa04eb3d2f39311de810' 
  AND (
    token = 'caJ8xYcgo1khYU7BlJbuR2FaTu3Chc/a+F3sZK+4xXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021