UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OJuVItLtON0q1gm36hhiA1t26KCswOP0Dm1SzLWzst0=' 
WHERE 
  key_id = '7f74c718441cc580387a7688324af44096c7f0a93abf4ec58e06ac7ec0b5c97c' 
  AND (
    token = 'OJuVItLtON0q1gm36hhiA1t26KCswOP0Dm1SzLWzst0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015