UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l6QR2rg++w4FqAeqGKhFVkApvlP233JmoEYmxFv0fvo='
WHERE
key_id = 'fe5ad90b296dec6bf344a48510b2ee843d623a54840322953b1d63d44c64aedd'
AND (
token = 'l6QR2rg++w4FqAeqGKhFVkApvlP233JmoEYmxFv0fvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)