UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dd5sBZ57ADTXdfzCx+06yhri45SEzMLZRV46AmrDAyc='
WHERE
key_id = '36d6cb9bf6079f8c1ffca38b46087ff41fcae01e56c87d28917018408dec7464'
AND (
token = 'dd5sBZ57ADTXdfzCx+06yhri45SEzMLZRV46AmrDAyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)