UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'meDxpjsQGduiQpIWI4B0BMsCbS2dqG0okIfqODfKR9E=' 
WHERE 
  key_id = '634b3fb7963231358d3553b2206d33e74a078c5e945520f5de82e139e54b1553' 
  AND (
    token = 'meDxpjsQGduiQpIWI4B0BMsCbS2dqG0okIfqODfKR9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027