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