UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+QTua1jy6zb9k+V8KK40hv8kgnIcHJ4Lc4vIE0sOoHY=' 
WHERE 
  key_id = 'f2dc64ce6cabd40e51acf7a0a681bd74932cd5f65b75d82fceae9b7614007862' 
  AND (
    token = '+QTua1jy6zb9k+V8KK40hv8kgnIcHJ4Lc4vIE0sOoHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036