UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qhu7SoOhB0cgrZTZ9d5tbxdgFV5dPctRND1QhNy0GC8=' 
WHERE 
  key_id = '78e046238961e9f0e66e7ba8eba193b8d26102ed1b0d52aab09195e4ef5c335d' 
  AND (
    token = 'qhu7SoOhB0cgrZTZ9d5tbxdgFV5dPctRND1QhNy0GC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016