UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'THYC80K0po6c55RHEF6EzYhdYHmQDo1hJbTeU8Kt5xo='
WHERE
key_id = 'fc7fcd1e67be28069ff07acd34bde15e5803f16f2f91e7b30ecdfb5caa62e72f'
AND (
token = 'THYC80K0po6c55RHEF6EzYhdYHmQDo1hJbTeU8Kt5xo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)