UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hSzQ7SPiiXFHBW/FWIXfdPPNuwtTi9xoS+5QBfo+ir8='
WHERE
key_id = '5e5bdbe012eaa8df3a3a182d6de7bc32c5f559592b65ab324e347e323aae55c4'
AND (
token = 'hSzQ7SPiiXFHBW/FWIXfdPPNuwtTi9xoS+5QBfo+ir8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)