UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sPVLvKWHkQ+UhBBCq+H4XHo7KD/jQTMLKF4rtFfk96E='
WHERE
key_id = '2e3d4fc7043f291ce2fcbb84462193904ead2978eefdffda665320d0aec2bc50'
AND (
token = 'sPVLvKWHkQ+UhBBCq+H4XHo7KD/jQTMLKF4rtFfk96E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)