UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G+sZKoVchfW2wVKbYHh3ruVOVg2Vuk6SQT8Qt+5mQck=' 
WHERE 
  key_id = '629db24c6529e676ae1d15e0fa5169f3c1ef49531cd45e33aaadd3e2c3656932' 
  AND (
    token = 'G+sZKoVchfW2wVKbYHh3ruVOVg2Vuk6SQT8Qt+5mQck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035