UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6A78NjcPDu+J0wrik25f5KPLLlCvCj2cmV7rVGg1Wus=' 
WHERE 
  key_id = 'd35becf2be3c5faacb2d704bdd21abd4cd1add04ebaf1b47924c9f90e5d38e56' 
  AND (
    token = '6A78NjcPDu+J0wrik25f5KPLLlCvCj2cmV7rVGg1Wus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032