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