UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HXGLDGd8tPhhacwqAKJcOId0ArQ+Jea9HGvD5rV8MBw='
WHERE
key_id = '05413cd819d5de3fcd60d8c85361996bde6ae234a171ac0fd77e71cbe3e425a3'
AND (
token = 'HXGLDGd8tPhhacwqAKJcOId0ArQ+Jea9HGvD5rV8MBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)