UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CldMQ4/M1xgTjl4Urxqy7483a8u+BubkRbRrwx7IJNA=' 
WHERE 
  key_id = '2f172628b4a46ab931e430a2a86386d831615d2cbf3f8c9a304c97ad417d1d8d' 
  AND (
    token = 'CldMQ4/M1xgTjl4Urxqy7483a8u+BubkRbRrwx7IJNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029