UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0WGBCstxTw0D9EwmlPBwv8Ju54YWUEJ2vgR2p1E8jMY=' 
WHERE 
  key_id = '2961445321794e05e845e6a2cb657c6ffb1798e426de9bdec916582042d3ce20' 
  AND (
    token = '0WGBCstxTw0D9EwmlPBwv8Ju54YWUEJ2vgR2p1E8jMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062