UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '25/5Ak/jwofZsercqRuxbLHR/Akg17+HL+5se2m/fDk=' 
WHERE 
  key_id = '182613747119025e0a99c4bb7f25350a4fcf8bc5f2f75ee2f3d52295f553c74e' 
  AND (
    token = '25/5Ak/jwofZsercqRuxbLHR/Akg17+HL+5se2m/fDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035