UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j86X/nSYpyeaWZZsqLBXp9oSYVxGChrWO8i/JaZoMcc=' 
WHERE 
  key_id = 'd417828d1215aa7153c351aa7cec3c03dd043a445f59f8380178d850c9a218a2' 
  AND (
    token = 'j86X/nSYpyeaWZZsqLBXp9oSYVxGChrWO8i/JaZoMcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046