UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BlTWDl+fo6AfB40jZmzaJAB8vnQyIt+gwmFr+oavgCk=' 
WHERE 
  key_id = '0982eb7eb3447b2b79dfc0c7a34cdb9ed35ed0e29d2fdf9597430d3e65d6d524' 
  AND (
    token = 'BlTWDl+fo6AfB40jZmzaJAB8vnQyIt+gwmFr+oavgCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034