UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PFAJdiLs4rQFyCvzOiEujKWScMRUJnsphGgUyej4DTk='
WHERE
key_id = '86016ddcd040aecfdc1c3c4ca7b8d35fb44473178165cc14a806d724ad24d215'
AND (
token = 'PFAJdiLs4rQFyCvzOiEujKWScMRUJnsphGgUyej4DTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)