UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ARFhykwnWKZqSV903OcOTzgb5Wz6qV3uPYzcJys/JVY=' 
WHERE 
  key_id = '62d960f3693a66a1c08401120b0f8dbb10bc78130029e517794b3ae0d962e518' 
  AND (
    token = 'ARFhykwnWKZqSV903OcOTzgb5Wz6qV3uPYzcJys/JVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029