UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q3WyQ6wn1rmqdS7YN/PMj1E2/gFHw5MsJRAA8ucOUiE=' 
WHERE 
  key_id = '9235a2e7a4869f85359969d2b9c59f3e901399ad9e62333acc1998a35431ddd7' 
  AND (
    token = 'Q3WyQ6wn1rmqdS7YN/PMj1E2/gFHw5MsJRAA8ucOUiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053