UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IC7Wb+V9LVfgIY44YHzTNbYkASyLLl+qtJuMqneBZrA='
WHERE
key_id = '77a8c1784aa387134de18dac352a24966c8031132b06d05944f84657a027d611'
AND (
token = 'IC7Wb+V9LVfgIY44YHzTNbYkASyLLl+qtJuMqneBZrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)