UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'flLOUC0TnumKQdYt04VI5D0S3x/OUJ3cCpky5UkVhVc=' 
WHERE 
  key_id = '942bed9db66ea62d96280db7242a89fec813d4393793e969aec7f23ce730092e' 
  AND (
    token = 'flLOUC0TnumKQdYt04VI5D0S3x/OUJ3cCpky5UkVhVc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017