UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iQVUrqiMihO/tk9cTX1qA7jUlaWVxrOjctkIt3sS9tk=' 
WHERE 
  key_id = '56da29e1dd562c2f20d70f88784a61aaf0e7a1491ea6b772e0ae67a025c0e23a' 
  AND (
    token = 'iQVUrqiMihO/tk9cTX1qA7jUlaWVxrOjctkIt3sS9tk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031