UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QkXutUvxL5DuJ+9N+h3thUoIAFaARMwKmJjnnfZMYLQ=' 
WHERE 
  key_id = '574d7ad31c959c6707b6c52ccbe172f4bc2d89ad8daac7f207e64b0220c43d9c' 
  AND (
    token = 'QkXutUvxL5DuJ+9N+h3thUoIAFaARMwKmJjnnfZMYLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036