UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xIMq4qCZeWlGoR4LcEXeLFBncKCe6QBwGaNax2OY9OI=' 
WHERE 
  key_id = 'cb887dea679d0cb100622622d0e5f0eccb48beca2dfde8bf55f72c6ec1da80b5' 
  AND (
    token = 'xIMq4qCZeWlGoR4LcEXeLFBncKCe6QBwGaNax2OY9OI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025