UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UI9T/W469bFSS6iFrZ9r0S8CO58KJlOGJfIUVweXKdc='
WHERE
key_id = '4282cc76e7aeedf635fe3a7aa14003a5d97995bc02c5e6bca8859c2853094454'
AND (
token = 'UI9T/W469bFSS6iFrZ9r0S8CO58KJlOGJfIUVweXKdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)