UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HF53pbhW5KoxSsJD8hW7RIT0zjf+HxJzaRUFj5CvcZE=' 
WHERE 
  key_id = '01040e5a9e0f7f810e4eb6fdeb24bf6a64f80de00d576fa3524d512915e0b057' 
  AND (
    token = 'HF53pbhW5KoxSsJD8hW7RIT0zjf+HxJzaRUFj5CvcZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060