UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't7xChxUK9LN+ZKP885cbnetQWZtr4p3BzFgQ+8j/4IE='
WHERE
key_id = '309178c68883ccc53283dffa928f3a743c96a5924922aef6554468db55f6d34a'
AND (
token = 't7xChxUK9LN+ZKP885cbnetQWZtr4p3BzFgQ+8j/4IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)