UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evrNEHxjjRrUCkRCYjM2SaZoRioW5bRuIsFmsAKKij0=' 
WHERE 
  key_id = 'dba7cdeeadd14f78b9902d1c85180d145ae35dae6f3edd1f43ec831c448523c1' 
  AND (
    token = 'evrNEHxjjRrUCkRCYjM2SaZoRioW5bRuIsFmsAKKij0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042