UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gUztorIQDSj/klVmT0V9UnSqh8gO1A75KAe2zX4Be5s='
WHERE
key_id = 'bf4e894318d5d1d902e502b3ba3d71487bf32645bc89a3eeb79c411c7911afe4'
AND (
token = 'gUztorIQDSj/klVmT0V9UnSqh8gO1A75KAe2zX4Be5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)