UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jNgBdrZt3VwBSCRExsgDQ675lDsm+HZd33PuFYmiCkA='
WHERE
key_id = 'bdcf2787f107f5d407afa7b51e0379f770658ac5a346b1ce77c482c699904111'
AND (
token = 'jNgBdrZt3VwBSCRExsgDQ675lDsm+HZd33PuFYmiCkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)