UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5D3oOZnKfkmj7gbtpNZaQ5JapJoItcKzdaA9JZWt2tY='
WHERE
key_id = 'b73b0866cd78f4099398ca85c4e0bd99e07ed726a0b112e258e832eab6b94995'
AND (
token = '5D3oOZnKfkmj7gbtpNZaQ5JapJoItcKzdaA9JZWt2tY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)