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

Query time 0.00057