UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EY+D83mgp+Jk+mzwUJK5jDtz+M3iddO1OR3r3nE8xfw=' 
WHERE 
  key_id = 'dac4fc50dd3bc6def3f2645f370295f081a98d13406477953ab44b10163c6a18' 
  AND (
    token = 'EY+D83mgp+Jk+mzwUJK5jDtz+M3iddO1OR3r3nE8xfw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023