UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HSZSX0Xgqov+CNR6oa9bGHWV9Jvm7zGPD8ReG93I6AY=' 
WHERE 
  key_id = '42869c04b9bd23c70760d4941fe46cf03e48f0aafd76e793184c34e51cb4a05c' 
  AND (
    token = 'HSZSX0Xgqov+CNR6oa9bGHWV9Jvm7zGPD8ReG93I6AY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032