UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LgQ3hO9855hFEBR82n9+KEXdpGDX8Kg/gQQ2PpChg5w='
WHERE
key_id = '1abb7ced82f499f2c33b64652f1b1169ea1c18bc1c528f26a695967d131f8432'
AND (
token = 'LgQ3hO9855hFEBR82n9+KEXdpGDX8Kg/gQQ2PpChg5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)