UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tr38NJI1zO6ClgzNRE6xgF8WnwoFN8qPrlJ79rBkzvg=' 
WHERE 
  key_id = '7cc009b0900442a46769211786c3f6c5ed9b963cc43bc094a286caaf47633a37' 
  AND (
    token = 'Tr38NJI1zO6ClgzNRE6xgF8WnwoFN8qPrlJ79rBkzvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035