UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+5RMNZcGLKx7F6P1Jgp6iFzYH2s39v0Z02I8CLoi5QM=' 
WHERE 
  key_id = '28ddad6d3638d947c453d4d656c44406c44a573d852eba854231d082217afba5' 
  AND (
    token = '+5RMNZcGLKx7F6P1Jgp6iFzYH2s39v0Z02I8CLoi5QM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031