UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3j43YMNb/1TAByGyh0jQgQg+horixvXkZJooTWDKypg='
WHERE
key_id = 'fa34f956df7a59f019073f385a1febf86e588c2e3a96b54f61a7d8dc6852b05c'
AND (
token = '3j43YMNb/1TAByGyh0jQgQg+horixvXkZJooTWDKypg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)