UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vvHdtqAFYpJf99T9gMgN0Lk7LXdd2Gp7/pNknABk9iQ='
WHERE
key_id = '5139f5695be8cea49336bb371d6dcf13a20f7c57b3f8a40d652615cc96298491'
AND (
token = 'vvHdtqAFYpJf99T9gMgN0Lk7LXdd2Gp7/pNknABk9iQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)