UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VT7tNX+8BvdQvF5Esfm3KQLa7+vZoHvKWpgfSV0fGro=' 
WHERE 
  key_id = 'b07420b419ca27d1d171aab541fdfc4b0f737c2cccebd005228613ad401fa566' 
  AND (
    token = 'VT7tNX+8BvdQvF5Esfm3KQLa7+vZoHvKWpgfSV0fGro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025