UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1fnE/LDViowOT06ZyjgDqq0M8IrliijjmNAnSyCEfws='
WHERE
key_id = 'e19e6a8e80ced9b94a0446af413060d6e2f8c1a64edad045d07733c528281b1f'
AND (
token = '1fnE/LDViowOT06ZyjgDqq0M8IrliijjmNAnSyCEfws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)