UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dkRx1W9Y43NjQauRgV3VyYwe/duH82MoJ8HWvgmOnno=' 
WHERE 
  key_id = '34d30434f798f0e626c1a9b54c777c8ae4a1d9e0211433c0db015836b394f29f' 
  AND (
    token = 'dkRx1W9Y43NjQauRgV3VyYwe/duH82MoJ8HWvgmOnno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053