UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pO2agjDegg8hUTjqXotEKkha2Tlj5MiqJpO7Yob/Emo=' 
WHERE 
  key_id = '450845655b7e72321dbf48988561d773f0a4a54edad2aed8870b2fd3cd3b327d' 
  AND (
    token = 'pO2agjDegg8hUTjqXotEKkha2Tlj5MiqJpO7Yob/Emo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046