UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+BwcqYF4IzH9nu+gljwsi0J5Oy+yXZGMzxFJUENQCDA='
WHERE
key_id = 'b55c374095fdce065d443929735226ffbc2ac2c9fc99439ecf730c5b36249274'
AND (
token = '+BwcqYF4IzH9nu+gljwsi0J5Oy+yXZGMzxFJUENQCDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)