UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RAppt6EvvNidFwvEDCW52+Cu/+yqDJDRmIQ/GWBQm7I='
WHERE
key_id = '2d6e6201c3a244414b85f0661c466194f5ef038bbb99364c73b8fbdad585c416'
AND (
token = 'RAppt6EvvNidFwvEDCW52+Cu/+yqDJDRmIQ/GWBQm7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)