UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'llUPP3yFOVgQFzTf+UFnjGHRu+hGOfr2b+OT/e+sCP8=' 
WHERE 
  key_id = 'eede53eb67ff06aa33e7f54c74006b6c5845ac2db7b692aa028076c864a94d87' 
  AND (
    token = 'llUPP3yFOVgQFzTf+UFnjGHRu+hGOfr2b+OT/e+sCP8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028