UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MjppzF8L1oPkL1C9gKhkrWz+OHTd89lZ4HEqqQ1KUCU='
WHERE
key_id = '919246f71f74f54c5e8bf4421429ae204560cfa82e65873364bce4e3bb3777e1'
AND (
token = 'MjppzF8L1oPkL1C9gKhkrWz+OHTd89lZ4HEqqQ1KUCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)