UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2AKacvie0TuwWYhUf3vwmg1QKFCg23l2oq/4ZOhVh0o=' 
WHERE 
  key_id = '21e7618c44fca56e0de9305a6d31dd6ca341d4550d3f2cd31cca9cebe9d63612' 
  AND (
    token = '2AKacvie0TuwWYhUf3vwmg1QKFCg23l2oq/4ZOhVh0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020