UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lGjhU6/xWIvmfnPz8q25O9nxwsudMqzyZxJmikDX5SM='
WHERE
key_id = '072f78dc279453b073cd6af0a0c017efafb61e3a79c58bd97c06e4ce669b767d'
AND (
token = 'lGjhU6/xWIvmfnPz8q25O9nxwsudMqzyZxJmikDX5SM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)