UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F6TSKCZu9WfTu7Ihd+xdnxNUQHIMMBbs++D3RPLiZsI=' 
WHERE 
  key_id = '174a551ce1af6a37afba66bda733806557b0d7d52348ab059db7689e7ec08e4b' 
  AND (
    token = 'F6TSKCZu9WfTu7Ihd+xdnxNUQHIMMBbs++D3RPLiZsI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045