UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bbACsRpzRDul7lMaehLpgh7NKrzVW53lnyDKD/ov0DI='
WHERE
key_id = 'afcb6a32d2c0d32f9e2b3471aca37b0f574ea4ce837c662508615f12c3441184'
AND (
token = 'bbACsRpzRDul7lMaehLpgh7NKrzVW53lnyDKD/ov0DI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)