UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f/fpGrsllr+0TKvZ8zUxDye9J7CrF/jVppbCnNntGGU=' 
WHERE 
  key_id = '9033d3dec783b93c96962cd4a0b3cf1d8a418e77cdcbf0843a16f0920df1dc4b' 
  AND (
    token = 'f/fpGrsllr+0TKvZ8zUxDye9J7CrF/jVppbCnNntGGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050