UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MmB/jZ2GwcgMyJAJHCLjRjnZquwexGo9vwCT7+gR22Y='
WHERE
key_id = 'e1e92c2900a930b7bcf28b1e471db3353bb6382b6a69dff43f95bbd85edb524c'
AND (
token = 'MmB/jZ2GwcgMyJAJHCLjRjnZquwexGo9vwCT7+gR22Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)